package com.ai.manager.edu.cms.info.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ai.dao.edu.cms.info.InfoPublishLocationMapper;
import com.ai.manager.edu.cms.info.InfoPublishLocationManager;
import com.ai.model.edu.cms.info.InfoPublishLocation;
import com.ai.model.edu.cms.info.dto.InfoPublishLocationDTO;
import com.ai.model.edu.cms.info.vo.InfoPublishLocationVO;

/**
 * @author daizy
 *
 */
@Component("infoPublishLocationManager")
public class InfoPublishLocationManagerImpl implements InfoPublishLocationManager {
	
	@Resource
	private InfoPublishLocationMapper infoPublishLocationMapper;

	/* 
	 * 批量新增  
	 * daizy
	 */
	@Override
	public void batchAddInfoPublishLocation(List<InfoPublishLocation> list) {
		infoPublishLocationMapper.batchAddInfoPublishLocation(list);
	}

	/* 
	 * 根据模块查询   需要发布的资讯信息
	 * daizy
	 * 
	 */
	@Override
	public List<InfoPublishLocationVO> findMustPublishLocationInfoByLocType(
			InfoPublishLocationDTO dto) {
		return infoPublishLocationMapper.findMustPublishLocationInfoByLocType(dto);
	}

	/* 
	 * 查询需要发布  该模块游客版面  信息
	 * daizy
	 */
	@Override
	public List<InfoPublishLocationVO> findMustPublishYkInfoByLocType(
			Byte locType) {
		return infoPublishLocationMapper.findMustPublishYkInfoByLocType(locType);
	}

	/* 
	 * 分模块  角色   查询个性化版面 信息
	 * daizy
	 */
	@Override
	public List<InfoPublishLocationVO> findGXInfoByLocTypeAndPyAndRc(
			InfoPublishLocationDTO dto) {
		return infoPublishLocationMapper.findGXInfoByLocTypeAndPyAndRc(dto);
	}

	/* 
	 * 批量修改发布状态
	 * daizy
	 */
	@Override
	public void batchEditInfoPublishLocation(List<Long> ids) {
		infoPublishLocationMapper.batchEditInfoPublishLocation(ids);
	}

    /***
     * 根据位置类型或者发布对象查询资讯列表
     * hankai
     * @param dto
     * @return
     */
    @Override
    public List<InfoPublishLocationVO> findInfoByLocTypeOrObjType(InfoPublishLocationDTO dto) {
        return infoPublishLocationMapper.findInfoByLocTypeOrObjType(dto);
    }

	/***
	 * 修改资讯发布状态和顺序
	 * @param dto
	 */
	@Override
	public void editInfoPublishLocation(InfoPublishLocationDTO dto){
		infoPublishLocationMapper.editInfoPublishLocation(dto);
	}
}